All Questions
Tagged with algorithmsdesign-patterns
56 questions
-1votes
2answers
125views
Algorithm for realtime database listener replacement?
I have a time-series database where I put all my data in it in timely-ordered fashion. Unfortunately, the database doesn't have any realtime listener capability built into it, and I need to make an ...
2votes
2answers
562views
Is this architecture overkill? What is a good way to architect this software?
I have an algorithm I am trying to implement that has steps 1 to 5. There are several different ways I could implement each step. Each calculation step is essentially just an astronomy calculation, ...
6votes
7answers
7kviews
How to avoid repeating "a==b" when comparing "condition a" and then "condition b" and then...?
For example, I have an object: public class Obj{ public int a; public float b; public String c; } I need to find best "Obj": largest a and then largest b and then longest c: int ...
0votes
1answer
112views
Multi dimensional lookups
I am looking to see if there is a general design pattern or strategy to handle a use case I see often in our codebases. My best attempt to generalize this use case is "Map permutations of n ...
1vote
4answers
332views
Most efficient way to represent a random ordering of the numbers 0-10
I am currently looking for a way to encode a list of random numbers most efficently (as in length). To be specific, I have an array of 11 numbers containing each number from 0 to 10. The order will be ...
0votes
1answer
136views
How to implement converters without needing to implement every permutation
I've got this class: [UsedImplicitly] public class ClassicalKeplerian { public ClassicalKeplerian(Angle argumentOfPeriapsis, Angle inclination, UnitFraction eccentricity, Angle ...
2votes
2answers
152views
Calculate operation time and setuptime or costprice based on a variable set of parameters - Design Pattern?
I work in a production company where my colleagues calculate costprices based on 3D models and their respective operations. Apart from workactivities where a user has to insert an operation time and ...
0votes
1answer
69views
Design a non replayable endpoint for a service
I am trying something out in Springboot and stuck with a weird issue where I want to send some data from my frontend (react app) to backend (SpringBoot) and make that request non replay able by users (...
-3votes
2answers
133views
What design pattern / class / interface should I use for encapsulating a program? [closed]
I am building a chess - related application, and I want to use a pre-compiled program called Stockfish as my chess engine. I am wondering what is the best practice to encapsulate the usage of the ...
1vote
4answers
303views
Software-design for algorithm engineering
I'm currently working on an program that solves a graph optimization problem. I know the "standard" software-design principles like information hiding, modularization, etc. What I'm ...
1vote
1answer
250views
Versioning of data handling pipeline elements
I have developed a custom-made Python package, which provides 2 classes to play with: Stage and Step. They operate based on a Chain of Responsibility design pattern, and behave in a way where: Both ...
0votes
1answer
81views
Pubsub model - publisher broadcast to remote subscribers
With a single publisher(go-routine) and multiple subscribers(go-routine) on same machine, below message hub help create pubsub model: type PublisherHub struct { subscribers map[*subscribmediator....
3votes
5answers
682views
Applying function to file line by line or read entirely into structure first?
I've often found myself with the need to develop tools that process large files over a network and perform an operation to every element in that file. An element may be an individual line or an object ...
1vote
2answers
391views
Algorithm for rule-based sorting?
I am trying to plant a garden. Certain plants are good for some plants and bad for others, and I am trying to find the best order of plants: most adjacent friends and no adjacent foes, as defined in ...
0votes
1answer
92views
Transitive matching in streaming application
Problem A streaming application should perform matching transitively i.e. if A == B & B == C then A == C Current Implementation Application accepts domain objects in a streaming fashion and ...